<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:h="http://java.sun.com/jsf/html">

<body>
	<ui:composition template="../template.xhtml">

		<ui:define name="right">

		</ui:define>

		<ui:define name="center">
			<h2>#{bundle.CreatePlatformTitle}</h2>

			<p:panel id="panel" header="#{bundle.CreatePlatformTitle}">

				<h:form enctype="multipart/form-data">

					<p:growl id="growl" showDetail="true" life="600" />
					<p:messages showDetail="true" autoUpdate="true" />

					<h:panelGrid columns="2" styleClass="grid">
						<h:outputLabel for="name"
							value="#{bundle.CreatePlatformLabel_accessionName} *" />
						<p:inputText id="name"
							label="#{bundle.CreatePlatformLabel_accessionName}"
							value="#{platformController.platform.accessionName}"
							validator="#{platformController.validateName}">

						</p:inputText>

						<h:outputLabel for="title"
							value="#{bundle.ViewPlatformLabel_title} *" />
						<p:inputTextarea id="title"
							label="${bundle.CreatePlatformLabel_title}"
							value="#{platformController.platform.title}"
							validator="#{platformController.validateTitle}">
						</p:inputTextarea>

						<h:outputLabel for="description"
							value="#{bundle.ViewPlatformLabel_description} " />
						<p:inputTextarea id="description"
							value="#{platformController.platform.description}"></p:inputTextarea>

						<h:outputLabel for="manufacturer"
							value="#{bundle.ViewPlatformLabel_manufacturer} *" />
						<p:inputTextarea id="manufacturer"
							label="${bundle.CreatePlatformLabel_manufacturer}"
							value="#{platformController.platform.manufacturer}"
							validator="#{platformController.validateManufacturer}">
						</p:inputTextarea>

						<h:outputLabel for="organism"
							value="#{bundle.CreatePlatformLabel_organismName} *" />
						<p:selectOneMenu id="organism"
							value="#{platformController.platform.organism.id}"
							required="true">
							<f:selectItems value="#{platformController.organisms}" var="o"
								itemLabel="#{o.name}" itemValue="#{o.id}" />
						</p:selectOneMenu>

						<h:outputLabel for="type"
							value="#{bundle.CreatePlatformLabel_typePlatform} *" />
						<p:selectOneMenu id="type"
							value="#{platformController.platform.typePlatform}"
							required="true">
							<f:selectItems value="#{platformController.types}" var="c"
								itemLabel="#{c.name}" itemValue="#{c.id}" />
						</p:selectOneMenu>

						<h:outputText value="#{bundle.CreatePlatformFileUpload} *" />
						<p:fileUpload
							fileUploadListener="#{platformController.handleFileUpload}"
							mode="advanced" update="messages" sizeLimit="100000000"
							allowTypes="/(\.|\/)(soft|SOFT|txt)$/"
							value="#{platformController.filePath}" />
					</h:panelGrid>
					<p:commandButton style="float: right" id="submit" value="Submit"
						ajax="false" action="#{platformController.create}" update="growl">

					</p:commandButton>

				</h:form>

			</p:panel>

		</ui:define>

	</ui:composition>

</body>
</html>